From: Julian Sparber Date: Wed, 14 Feb 2024 18:24:01 +0000 (+0100) Subject: messageTray: Use new `notification-removed` signal to cleanup notifications X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~1^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=050e4e9a6e2e76006a5e0d0cdd3d164cbd0270b2;p=gnome-shell.git messageTray: Use new `notification-removed` signal to cleanup notifications Part-of: --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index a861219a4..d7d21f666 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -925,6 +925,7 @@ export const MessageTray = GObject.registerClass({ source.connectObject( 'notification-show', this._onNotificationShow.bind(this), + 'notification-removed', this._onNotificationRemoved.bind(this), 'destroy', () => this._removeSource(source), this); this.emit('source-added', source); @@ -952,7 +953,7 @@ export const MessageTray = GObject.registerClass({ } } - _onNotificationDestroy(notification) { + _onNotificationRemoved(source, notification) { if (this._notification === notification) { this._notificationRemoved = true; if (this._notificationState === State.SHOWN || @@ -983,8 +984,6 @@ export const MessageTray = GObject.registerClass({ let bannerCount = this._notification ? 1 : 0; let full = this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE; if (!full || notification.urgency === Urgency.CRITICAL) { - notification.connect('destroy', - this._onNotificationDestroy.bind(this)); this._notificationQueue.push(notification); this._notificationQueue.sort( (n1, n2) => n2.urgency - n1.urgency);